home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr49
/
352_01.zip
/
STRPPCMP.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-10
|
715b
|
27 lines
// STRPPCMP.CPP - contains String::cmp()
// This routine in the String class compares two strings.
// Case sensitive or not, as set by String::caseSens.
//
#include <stdlib.h>
#include <string.h>
#include <alloc.h>
#include <iostream.h>
#include <ctype.h>
#include "dblib.h"
// NOTE: routine declared static in class {}. No 'this' ptr.
int String::cmp (char *a, char *b)
// String::cmp is a utility function for class String.
// routine compares two strings
// checks for caseSens compares
{
if ( a==NULL )
return ( b==NULL ) ? 0 : -1;
else
if ( b== NULL )
return +1;
else
return String::caseSens ? strcmp (a,b) : stricmp (a,b);
} // end String::cmp()